<?php

namespace App\Http\Repository;

use App\Gater;

class GaterRepository
{
    private $gater;

    public function __construct(Gater $gater)
    {
        $this->gater = $gater;
    }

    //得到分组权限
    public function getGroupGater()
    {
        $tmpGater = $this->gater
            ->select('id', 'note', 'group')
            ->get();
        foreach ($tmpGater as $gater) {
            $groupGater[$gater->group][] = $gater;
        }
        return $groupGater;
    }
}